<?php 
include "method/win.php";
if(isset($_POST['submit'])){
    findpassword($_POST['username'], md5($_POST['password']), $_POST['telephone']);
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>小狗微博登录页面</title>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/login.css">
    <link rel="stylesheet" href="../lib/bootstrap/css/bootstrap.css">
    <script src="../lib/jquery/jquery.js" type=text/javascript></script>

</head>
<body>
<script type="text/javascript">
function check(){
	if(myform.username.value==""){
		alert("用户名不能为空!");
		return false;
	}
	if(myform.telephone.value=="" ){
		alert("验证码不能为空!");
		return false;
	}
	if(myform.password.value=="" ){
		alert("密码不能为空!");
		return false;
	}
	return true;
}
</script>

<form id="myform" name="myform" class="well" action='' method='post' onsubmit="return check()"
      style="width: 30em; margin: auto; margin-top: 150px;">
    <h3>找回密码</h3>
    <div class=" input-group input-group-md">
              <span class="input-group-addon" id="sizing-addon1"><i
                      class="glyphicon glyphicon-user" aria-hidden="true"></i></span> <input
            id="username" type="text" class="form-control" placeholder="用户名" name="username"
            aria-describedby="sizing-addon1"/>
    </div>
    <br/>
    <div class="input-group input-group-md">
              <span class="input-group-addon"><i class="glyphicon glyphicon-phone"></i></span>
        <input type="text"
               id="telephone" class="form-control"
               placeholder="注册手机号码" name="telephone"
               aria-describedby="sizing-addon1"/>
    </div>
    <br/>
    <div class="input-group input-group-md">
        <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
        <input type="password"
               id="password" class="form-control" name="password"
               placeholder="新密码"
               aria-describedby="sizing-addon1"/>
    </div>
    <div id="error_box"><br></div>
    <button type="submit" name="submit" class="btn btn-success btn-block">确定</button>
    <a class="btn btn-sm btn-white btn-block" style="text-align: right;" href="login.php"><h6>返回登录</h6></a>
    <a class="btn btn-sm btn-white btn-block" style="text-align: right;" href="register.php"><h6>还没有账户？前往注册</h6></a>
</form>
</body>
</html>
